/*! \file Primitive.h
 *	\brief <write description for Primitive.h>
 *
 *	created:	2009/11/17
 *	created:	17:11:2009   15:14
 *	filename: 	o:\main\libs\gd_dx9\Primitive.h
 *	file path:	o:\main\libs\gd_dx9
 *	file base:	Primitive
 *	file ext:	h
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */

#ifndef _GD_DX9_PRIMITIVE_H_
#define _GD_DX9_PRIMITIVE_H_

#pragma once

#include <core/defs.h>
#include <gd/Primitive.h>
#include <gd/VertexFormat.h>
#include <utils/COMPointer.h>

namespace tt{
namespace gd_dx9{

class Device;

class Primitive: public gd::Primitive
{
	TT_DECLARE_SELF_AND_BASE(Primitive, gd::Primitive);
public:
	Primitive(Device*);

protected:
	virtual void onCreate(const gd::VertexFormat&, UInt vertices, UInt indices);

private:
	Device* m_device;
	gd::VertexFormat m_vertexFormat;
	utils::COMPointer<IDirect3DVertexBuffer9> m_vertices;
	utils::COMPointer<IDirect3DIndexBuffer9> m_indices;
};

} //namespace gd_dx9
} //namespace tt

#endif //_GD_DX9_PRIMITIVE_H_